Type.registerNamespace("Hxsoft.Web.UI.WebControls");

Hxsoft.Web.UI.WebControls.ModalUpdateProgress = function(element)
{
	Hxsoft.Web.UI.WebControls.ModalUpdateProgress.initializeBase(this, [element]);
	
	var fakeElement = document.createElement("div");
	this._modalPopupBehavior = new AjaxControlToolkit.ModalPopupBehavior(fakeElement);
	this._modalPopupBehavior.set_PopupControlID(this.get_element().id);
}
Hxsoft.Web.UI.WebControls.ModalUpdateProgress.prototype = 
{
	initialize : function()
	{
		Hxsoft.Web.UI.WebControls.ModalUpdateProgress.callBaseMethod(this, 'initialize');
		
		this._modalPopupBehavior.initialize();
	},
	
	get_backgroundCssClass : function()
	{
		return this._modalPopupBehavior.get_BackgroundCssClass();
	},
	set_backgroundCssClass : function(value)
	{
		this._modalPopupBehavior.set_BackgroundCssClass(value);
	},
	
	get_dropShadow : function()
	{
		return this._modalPopupBehavior.get_DropShadow();
	},
	set_dropShadow : function(value)
	{
		return this._modalPopupBehavior.set_DropShadow(value);
	},
	
	get_drag : function()
	{
		return this._modalPopupBehavior.get_Drag();
	},
	set_drag : function(value)
	{
		return this._modalPopupBehavior.set_Drag(value);
	},
	
	get_x : function()
	{
		return this._modalPopupBehavior.get_X();
	},
	set_x : function(value)
	{
		return this._modalPopupBehavior.set_X(value);
	},
	
	get_y : function()
	{
		return this._modalPopupBehavior.get_Y();
	},
	set_y : function(value)
	{
		return this._modalPopupBehavior.set_Y(value);
	},
	
	get_popupDragHandleControlID : function()
	{
		return this._modalPopupBehavior.get_PopupDragHandleControlID();
	},
	set_popupDragHandleControlID : function(value)
	{
		return this._modalPopupBehavior.set_PopupDragHandleControlID(value);
	},

	_startRequest : function()
	{
		if (this._pageRequestManager.get_isInAsyncPostBack())
		{
            this._modalPopupBehavior.show();
        }
        
        this._timerCookie = null;
	},
	
	_handleEndRequest : function(sender, arg)
	{
		this._modalPopupBehavior.hide();
		
        if (this._timerCookie)
        {
            window.clearTimeout(this._timerCookie);
            this._timerCookie = null;
        }		
	}
}
Hxsoft.Web.UI.WebControls.ModalUpdateProgress.registerClass("Hxsoft.Web.UI.WebControls.ModalUpdateProgress", Sys.UI._UpdateProgress);